package com.sunstar.koobaselib.kootl.comm.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.view.ViewGroup;

import com.sunstar.koobaselib.news.ui.NewsListFragment;

/**
 * Created by louisgeek on 2017/1/3.
 *
 * 未测试
 * http://blog.csdn.net/minimicall/article/details/41487653
 */

public class FixFragmentPagerAdapter extends FragmentPagerAdapter {

    public FixFragmentPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        NewsListFragment newsListFragment = NewsListFragment.newInstance("", "", 0);
        return newsListFragment;
    }

    @Override
    public int getCount() {
        return 0;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
       // return super.instantiateItem(container, position);
        NewsListFragment newsListFragment= (NewsListFragment) super.instantiateItem(container, position);
       /* newsListFragment.setter config some data*/
        return newsListFragment;
    }

    @Override
    public int getItemPosition(Object object) {
        //return super.getItemPosition(object);
        return PagerAdapter.POSITION_NONE;
    }
}
